package com.g5.edu.controller;


import com.g5.edu.model.DfStudyFile;
import com.g5.edu.service.IDfStudyFileService;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author admin
 * @since 2021-10-29
 */
@RestController
@RequestMapping("/edu/dfStudyFile")
public class DfStudyFileController {
    @Autowired
    private IDfStudyFileService iDfStudyFileService;

    @GetMapping("/file_list")
    public List<DfStudyFile> dfStudyFiles (){
        List<DfStudyFile> dfStudyFiles =iDfStudyFileService.getDfStudyFile();
        return dfStudyFiles;
    }
    @GetMapping("/file_list_page")
    public PageInfo<DfStudyFile> list(Integer pageNum){
        Integer pageSize=2;
        if (pageNum==null){
            pageNum=1;
        }
        PageInfo<DfStudyFile> pageInfo = iDfStudyFileService.getDfStudyFile(pageNum,pageSize);
        return pageInfo;
    }
}
